widget factory: Use GtkPicture for background selection
authorTimm Bäder <mail@baedert.org>
Sun, 8 Jul 2018 19:48:17 +0000 (21:48 +0200)
committerTimm Bäder <mail@baedert.org>
Sun, 8 Jul 2018 19:50:59 +0000 (21:50 +0200)
Showing those background images as 16×16 icons doesn't look very nice.

demos/widget-factory/widget-factory.c

index 836eae77afb506b2bcf21f973631f055007ef3f5..d0e2cafbb15d8b6d25751759eceba06fd547d05e 100644 (file)
@@ -966,8 +966,8 @@ background_loaded_cb (GObject      *source,
       return;
     }
 
-  child = gtk_image_new_from_pixbuf (pixbuf);
-  gtk_widget_show (child);
+  child = gtk_picture_new_for_pixbuf (pixbuf);
+  gtk_widget_set_size_request (child, 110, 70);
   gtk_flow_box_insert (GTK_FLOW_BOX (bd->flowbox), child, -1);
   child = gtk_widget_get_parent (child);
   g_object_set_data_full (G_OBJECT (child), "filename", bd->filename, g_free);
@@ -995,8 +995,7 @@ populate_flowbox (GtkWidget *flowbox)
 
   pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 110, 70);
   gdk_pixbuf_fill (pixbuf, 0xffffffff);
-  child = gtk_image_new_from_pixbuf (pixbuf);
-  gtk_widget_show (child);
+  child = gtk_picture_new_for_pixbuf (pixbuf);
   gtk_flow_box_insert (GTK_FLOW_BOX (flowbox), child, -1);
 
   location = "/usr/share/backgrounds/gnome";